class Questionnaire < ActiveRecord::Base
	belongs_to :data_collection
	# belongs_to :questionnaire_status
	belongs_to :questionnaire_name
	has_many :questionnaire_events, :dependent => :destroy


	def get_last_event()
		if (self.questionnaire_events.last.nil?)
			return nil
		end
		
		return [self.questionnaire_events.last.questionnaire_event_type.name, self.questionnaire_events.last.comment] 
	end	
end
